from django.shortcuts import render

# Create your views here.
from django.views import View
# from django.forms import forms

# from DjangoUeditor.forms import UEditorField
from details.models import BlogContent



class DetailsView(View):
    """
    文章详情
    """
    def get(self, request,x):

        blog = BlogContent.objects.filter(id=x).first()
        blog.read = blog.read + 1
        blog.save()
        articles = BlogContent.objects.filter(user=1).order_by('-last_time')[:10]
        return render(request,'blog/htmls/calmlog-details.html',{'blog':blog,'articles':articles})